/*
 * Copyright© 2003-2019 浙江汇信科技有限公司, All Rights Reserved.
 */
package com.icinfo.cloud.provider.punish.ucase.casemain.controller;

import com.icinfo.cloud.provider.common.constant.Constant;
import com.icinfo.cloud.provider.punish.external.cadjjbxx.service.impl.ExternalService;
import com.icinfo.cloud.provider.punish.ucase.casemain.model.CaseProsecutionJudgment;
import com.icinfo.cloud.provider.punish.ucase.casemain.service.ICaseProsecutionJudgmentService;
import com.icinfo.framework.common.web.Result;
import com.icinfo.framework.core.web.BaseController;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 描述: 案件诉讼判决表 case_prosecution_judgment 对应的Controller类.<br>
 *
 * @author framework generator
 * @date 2022年12月01日
 */
@RestController
@RefreshScope
@RequestMapping("/punish/ucase/prosecutionJudgment")
@Controller
public class CaseProsecutionJudgmentController extends BaseController {
    /**
     * 日志记录器
     */
    private static final Logger logger = LoggerFactory.getLogger(CaseProsecutionJudgmentController.class);

    @Autowired
    private ICaseProsecutionJudgmentService caseProsecutionJudgmentService;

    @Autowired
    private ExternalService externalService;

    /**
     * 获取案件判决信息
     *
     * @param ahdm 案号代码
     * @return 案件判决信息
     * @author lilihao
     * @date 2022/12/2 20:39
     */
    @PostMapping("/getDetail")
    @ApiOperation(value = "【V1.9.3】描述：获取案件诉讼判决信息", httpMethod = "POST")
    public Result<CaseProsecutionJudgment> getDetail(@RequestParam(value = "ahdm") String ahdm) {
        CaseProsecutionJudgment judgmentInfo = externalService.getJudgmentInfo(ahdm);
        return Result.success(Constant.STRING_GET_SUCCESS, judgmentInfo);
    }
}